<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fns" uri="/WEB-INF/tlds/fns.tld" %>
<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8" />
		<title>ace Admin</title>
		<meta name="description" content="" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<jsp:include page="inc/inc.jsp" />
	</head>
	<body>
		<div class="easyui-layout" data-options="fit:true">
			<div data-options="region:'north'" class="head_body" style="overflow:hidden;">
				<div>
					<div class="head_left"></div>
					<div class="head_right">
				   		<div class="huanying">
				   			欢迎 <span>xxx</span> 登陆  | 现在是<span id="show_date"></span>
				   		</div>
				   		<div class="anniu">
				   			<div class="bb">
				   				<a href="javascript:logout();" class="logout"></a>
				   				<a id="open_change_password" class="changePwd"  href="javascript:void(0);"></a>
				   			</div>
				   			<div class="bs">	
								<a class="styleswitch a1" style="CURSOR: pointer" title="黑灰色" rel="black"></a>	
								<a class="styleswitch a2" style="CURSOR: pointer" title="天蓝色" rel="default"></a>	
								<a class="styleswitch a3" style="CURSOR: pointer" title="灰色" rel="bootstrap"></a>	
								<a class="styleswitch a4" style="CURSOR: pointer" title="浅灰色" rel="gray"></a>	
								<a class="styleswitch a5" style="CURSOR: pointer" title="白色" rel="metro"></a> 
							</div>
				   		</div>
				 	</div>
				</div>
			</div>
			
			<div data-options="region:'west',split:true,title:'导航菜单'" style="width:188px;">
                <%--<div class="easyui-accordion" id="main-accordion" data-options="fit:true,border:false">--%>
                    <%--<div title="内容管理" data-options="iconCls:'icon-menu'" style="overflow:auto;padding:10px;">--%>
                        <ul class="easyui-tree menu_tree">
                            <li data-options="iconCls:'icon-3menu'"><span><a target="mainFrame" onclick="addTab('新闻管理','${pageContext.request.contextPath}/news_page','icon-3menu')">新闻管理</a></span></li>
                            <li data-options="iconCls:'icon-3menu'"><span><a target="mainFrame" onclick="addTab('产品管理','${pageContext.request.contextPath}/product_page','icon-3menu')">产品管理</a></span></li>
                            <li data-options="iconCls:'icon-3menu'"><span><a target="mainFrame" onclick="addTab('联系我们','','icon-3menu')">联系我们</a></span></li>
                        </ul>
                    <%--</div>--%>
                <%--</div>--%>
            </div>
			
			<div id="mainPanel" data-options="region:'center'">
				<div id="index_tabs" class="easyui-tabs" data-options="fit:true,border:false,tabHeight:30" style="height:600px;">
			        <div title="首页">
			            <div style="padding:10px 0 10px 10px">
							<h2>系统介绍</h2>
							<div class="light-info">
								<div class="light-tip icon-tip"></div>
								当前在线人数:${applicationScope.onlineCount }
								<h3><a href="javascript:custom();">定制</a></h3>
							</div>
						</div>
			        </div>
	    		</div>
			</div>
		</div>
	</body>
</html>

<script type="text/javascript">
	$(document).ready(function(){
// 		设置tab高度，浏览器当前窗口可视区域高度 -头部高度
//		 $("#index_tabs").height($(window).height()-$("#navbar").height());
		 
		//显示系统时间
		var myDate = new Date();
		var week = ['日','一','二','三','四','五','六'];  
		var month = myDate.getMonth()+1; 
		var weekDay = " 星期"+week[myDate.getDay()];
		var showDate = myDate.getFullYear()+"年"+month+"月"+myDate.getDate()+"日"+weekDay;
		$("#show_date").text(showDate);

		$('#main-accordion').accordion('getSelected').panel('collapse');//默认全部关闭
		  
	})
	
	//初始化TABS组件
	$('#index_tabs').tabs({
		fit : true,
		border : false,
		tabHeight : 30,
		tools : [{
			iconCls : 'icon-reload',
			handler : function() {
				var currTab = $('#index_tabs').tabs('getSelected');  
				var index = $('#index_tabs').tabs('getTabIndex', currTab);
				if(index != 0) {
					var updateUrl = $(currTab.panel('options').content).attr('src');
					$('#index_tabs').tabs('update', {
						tab : currTab,
						options : {
							content : refreshTab(updateUrl)
						}
					});
				} 
			}
		},{
			iconCls : 'icon-clear',
			handler : function() {
				$.messager.confirm('提示','确定要全部关闭选项卡?',function(r){
					if (r){
						var tabTitle = new Array();  
				        var tabs = $('#index_tabs').tabs("tabs");  
				        var tCount = tabs.length;  
				        if(tCount>0){  
				   			for(var i=0;i<tCount;i++){  
				   				tabTitle.push(tabs[i].panel('options').title);
				    		}  
				   			for(var i=0;i<tabTitle.length;i++){  
				   				if(tabTitle[i]!='首页') {
				   					$('#index_tabs').tabs("close", tabTitle[i]);  
				   				}
				   			}  
				 		}  
					}
				});
			}
		}]
	});
	
	/**
	 * 关闭sonTitle名的tab,刷新parentTitle名的tab下的datagird,
	 * 需在名为parentTitle的tab的window.top下添加相应方法window.top["reload_data"]=function(){...};
	 */
	function reloadTabGrid(parentTitle, sonTitle) {
		$("#index_tabs").tabs('close', sonTitle);
    	if ($("#index_tabs").tabs('exists', parentTitle)) {
        	$("#index_tabs").tabs('select', parentTitle);
        	window.top.reload_data.call();
        }
  	}



	
	
</script>